<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty translate block
 * the parameters are passed under {translate} open tag
 * ex pass 2 params into translate tag 
 * {translate p1=$name p2 =100 } name %s  age %s {/translate}
 * the output : name [$name] age 100
 * Type:     block<br>
 * Name:     translate<br>
 * Purpose:  Translating
 * @return string
 */
function smarty_block_translate ($params, $content, &$smarty, &$open)
{
	if ($open) {
            // Called when at open tag
            // no need to do anything here           
    } else {	
		if (isset($content)) {	
			//reindex to access by index number			
			$params = array_values($params);				
			return L10nHelper::_($content,$params);				
		}
	}
}

?>
